package com.xoa.controller.party.partyDues;

import com.xoa.service.party.partyDues.PartyDuesService;
import com.xoa.util.ToJson;
import com.xoa.model.party.partyDues.PartyDues;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by crr on 2018/3/27.
 */

@Controller
@RequestMapping("/partyDues")
public class PartyDuesController {


    @Autowired
    private PartyDuesService partyDuesService;
    @ResponseBody
    @RequestMapping("/addPartyDues")
    public ToJson<PartyDues> addPartyDues(PartyDues partyDues, HttpServletRequest request){
        return partyDuesService.addPartyDues(partyDues,request);
    }
    @ResponseBody
    @RequestMapping("/delPartyDuesById")
    public ToJson<PartyDues> delPartyDuesById(Integer id){
        return partyDuesService.delPartyDuesById(id);
    }
    @ResponseBody
    @RequestMapping("/updateByPrimaryKey")
    public ToJson<PartyDues> updateByPrimaryKey(PartyDues partyDues){
        return partyDuesService.updateByPrimaryKey(partyDues);
    }
    @ResponseBody
    @RequestMapping("/selectDuesById")
    public ToJson<PartyDues> selectDuesById(Integer id){
        return partyDuesService.selectDuesById(id);
    }
    @ResponseBody
    @RequestMapping("/selectAllDues")
    public ToJson<PartyDues> selectAllDues(PartyDues partyDues,Integer page,Integer pageSize,boolean useFlag){
        return partyDuesService.selectAllDues( partyDues, page, pageSize, useFlag);
    }
}
